// Module.h

#ifndef _MODULE_h
#define _MODULE_h

#include "global.h"
#include "ModuleRequest.h"
#include "Listenable.h"

typedef enum {
    TYPE_I2C = 0,
    TYPE_SPI,
} DataBusType;

typedef enum {
    ADC = 0,
    BATTERY,
    RECORD
} ModuleType;

class Module : public Listenable
{
public:
    string id;
public:
    Module(string id) : id(id) {};
    virtual bool accept(ModuleRequest& request) = 0;
    virtual bool checkAlive() = 0;
    virtual DataBusType getDataBusType() = 0;
    virtual ModuleType getType() = 0;
};

#endif

